package speedball;

import javafx.application.Application;
import javafx.geometry.Insets;
import javafx.scene.Scene;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Pane;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.VBox;
import javafx.scene.paint.Color;
import javafx.scene.shape.Arc;
import javafx.scene.shape.Circle;
import javafx.scene.shape.Ellipse;
import javafx.scene.shape.Line;
import javafx.scene.shape.Polygon;
import javafx.scene.shape.Polyline;
import javafx.scene.shape.Rectangle;
import javafx.stage.Stage;
 
public class ProgressShape extends Application {
 
    @Override
    public void start(Stage primaryStage) throws Exception {
        BorderPane pane = new BorderPane();
        
        Pane paneTop = new Pane();
        GridPane paneRight = new GridPane();
        HBox paneLeft = new HBox();
        StackPane paneCenter = new StackPane();
        VBox paneBottom = new VBox();
        
        Circle circle1 = new Circle(100, 100, 50);
        Circle circle2 = new Circle(100, 100, 50);//一个圆只能添加进一个面板中，要两个面板都显示圆这要创建两个圆
        Circle circle3 = new Circle(100, 100, 50);
        
        Line line = new Line(10, 10, 100, 100);
        
        Rectangle r1 = new Rectangle(100, 100);//只定义长，宽
        Rectangle r2 = new Rectangle(200, 50);
        r2.setFill(Color.color(0, 0, 1, 0.3));
        r2.setFill(Color.WHITE);
        
        Ellipse e = new Ellipse(100, 50);
        e.setFill(Color.WHITE);
        e.setStroke(Color.BLUE);
        
//        Arc arc = new Arc(1000, 100, 100, 50,  0, 90);
        Arc arc = new Arc(1000, 3, 3, 3,  0, 180);
//        arc.setStroke(Color.BLUE);
        
        arc.setStroke(Color.rgb(34,177,86));
        arc.setFill(Color.rgb(24,183,92));
        
        
//        Arc arc2 = new Arc(1000, 3, 3, 3,  0, 180);

        
        Ellipse arc2 = ShapeManage.createEllipse(3D, 3D, 1.5D);
      
        arc2.setStroke(Color.rgb(24,183,92));
        arc2.setFill(Color.rgb(24,183,92));
        
        Rectangle arc3 = ShapeManage.createRectangle(10,10, 10, 60, 10, 10);
        
        arc3.setStroke(Color.rgb(24,183,92));
        arc3.setFill(Color.rgb(24,183,92));
        
        
        
        Polygon p1 = new Polygon(200, 100, 200, 200, 10, 30, 320, 23);
        p1.setStroke(Color.RED);
        p1.setFill(Color.WHITE);
        Polyline p2 = new Polyline(200, 100, 200, 200, 10, 30, 320, 23);
        
        paneTop.getChildren().add(circle1);
        paneTop.setStyle("-fx-border-color: red");//定义边框颜色
        paneTop.setPadding(new Insets(10, 10, 10, 10));//定义面板四周空余的部分
        
        paneRight.add(circle2, 0, 0);
        paneRight.add(r1, 1, 1);
        paneRight.setStyle("-fx-border-color: blue");
        
        paneLeft.getChildren().add(line);
        paneLeft.getChildren().add(circle3);//圆的坐标可以没有
        paneLeft.setStyle("-fx-border-color: green");
        
        paneBottom.getChildren().add(arc);
        paneBottom.getChildren().add(arc2);
        paneBottom.getChildren().add(arc3);
        
        paneBottom.getChildren().add(p1);
        paneBottom.getChildren().add(p2);
        paneBottom.setStyle("-fx-border-color: orange");
        
        paneCenter.getChildren().add(e);
        paneCenter.getChildren().add(r2);
        
        pane.setTop(paneTop);
        pane.setRight(paneRight);
        pane.setLeft(paneLeft);
        pane.setCenter(paneCenter);
        pane.setBottom(paneBottom);
        
        Scene scnen = new Scene(pane);
        primaryStage.setTitle("12");
        primaryStage.setScene(scnen);
        primaryStage.show();
        
    }
    
    public static void main(String[] args){
        Application.launch(args);
    }
}
